<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>员工管理</title>
    <script src="${pageContext.request.contextPath}/res/js/jquery-3.5.1.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/res/bootstrap-4.5.0-dist/css/bootstrap.min.css">
    <script src="${pageContext.request.contextPath}/res/bootstrap-4.5.0-dist/js/bootstrap.min.js"></script>
    <link href="${pageContext.request.contextPath}/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <a class="navbar-brand" href="http://www.kgc.cn">课工场</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <form class="form-inline my-2 my-lg-0">
        <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
        <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
    </form>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav  ml-auto">
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
                   aria-haspopup="true" aria-expanded="false">
                    操作者:${sessionScope.operator.nickname}
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                    <a class="dropdown-item" href="${pageContext.request.contextPath}/person.action?methodName=logout">logout</a>
                    <a class="dropdown-item" href="#">Another action</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="#">Something else here</a>
                </div>
            </li>
        </ul>
    </div>
</nav>
<table class="table table-hover table-bordered">
    <thead class="thead-light">
    <tr align="center">
        <th><input type="checkbox" id="isAll"></th>
        <th>序号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>性别</th>
        <th>出生日期</th>
        <th>手机</th>
    </tr>
    </thead>
    <tbody>

    <c:forEach items="${requestScope.persons}" var="person" varStatus="item">
        <tr align="center">
            <td><input type="checkbox"></td>
            <td>${item.count}</td>
            <td>${person.nickname}</td>
            <td>${person.age}</td>
            <td>
                <c:if test="${person.gender == 1}">精神小伙儿</c:if>
                <c:if test="${person.gender == 0}">扒蒜小妹儿</c:if>
            </td>
            <td><fmt:formatDate value="${person.birthday}" pattern="yyyy-MM-dd"/></td>
            <td>${person.mobile}</td>
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>
